#include "rate.hpp"
#include <iostream>
#include <boost/numeric/ublas/io.hpp>
#include <cmath>
using namespace boost::numeric::ublas;

double y1(int jj,int dx,int N,double Omega){
  double pi=3.141592653589793238462;
  return exp(-2*pi*double(jj)*dx/double(N))*sin(2*pi*double(jj)*Omega/double(N));

}

double y2(int jj,int dx,double A){
  return 20-double(jj)*dx*A;
}

int main(){
  
  int N=40;
  int dx=1;
  double Omega=9;
  int int_lev=4;
  
  vector<double> x(N);
  vector<double> y(N);
  
  vector<double> x_i(int_lev*N-1);
  vector<double> y_i(int_lev*N-1);
  vector<double> y_ii(int_lev*N-1);

  for(int ii=0;ii<N;ii++){
    x[ii]=ii*dx;
    y[ii]=y1(ii,dx,N,Omega);
  }
  rate r(y,double(dx));
  rate r1(r);
  rate r2=r1;
  
  for(int ii=0;ii<int_lev*N-1;ii++){
    x_i[ii]=ii*dx/double(int_lev);
    y_i[ii]=r(ii*dx/double(int_lev));
    y_ii[ii]=r(ii*dx/double(int_lev));
  }
  
  std::cout<<x<<std::endl;
  std::cout<<y<<std::endl;
  std::cout<<x_i<<std::endl;
  std::cout<<y_i<<std::endl;
  std::cout<<y_ii<<std::endl;
  return 0;
}
